﻿<UserControl x:Class="TextEditor.ReadonlyCtrl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" BorderBrush="{x:Static SystemColors.ControlDarkBrush}" BorderThickness="1,0,1,0" Foreground="{x:Static SystemColors.ControlTextBrush}">
    <Grid Background="{x:Static SystemColors.ControlBrush}" >
        
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition/>
		</Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

		
		<Rectangle Grid.ColumnSpan="4" Fill="DodgerBlue" Height="2"/>
        <Button Grid.Row="1" Grid.Column="2" Margin="2" Content="Edit" Width="75" Click="ButtonBase_OnClick"/>
		<Button Grid.Row="1" Grid.Column="3" Margin="2,6" Content="X" Click="OnHide" Width="15" Height="15">
            <Button.Template>
                <ControlTemplate>
                    <Grid>
                        <Rectangle Fill="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                        <Path Stretch="Fill" Fill="Black" Data="M50,0C22.388,0,0,22.388,0,50c0,27.611,22.388,50,50,50c27.611,0,50-22.389,50-50C100,22.388,77.611,0,50,0z M74.73,65.895	l-8.838,8.838L50,58.838L34.106,74.73l-8.838-8.838L41.162,50L25.269,34.106l8.838-8.838L50,41.162l15.895-15.894l8.838,8.838 	L58.838,50L74.73,65.895z"
                              Cursor="{x:Static Cursors.Hand}" ToolTip="Hide panel"/>
                    </Grid>
                </ControlTemplate>
            </Button.Template>
        </Button>

		<TextBlock Grid.Row="1" Margin="20,0,20,0" VerticalAlignment="Center" TextAlignment="Center" Text="This file is opened in readonly mode." Grid.Column="1"/>
		<Image x:Name="image" Grid.Row="1" Stretch="UniformToFill" Height="25" VerticalAlignment="Center"/>

    </Grid>
</UserControl>
